package com.lujianfei.productprice.ui.addShop;

import com.lujianfei.productprice.ui.main.ShopEntity;

public class AddShopModel implements AddShopContract.Model{
    private ShopEntity shopEntity;
    @Override
    public ShopEntity getData(long id) {
        shopEntity = ShopEntity.findById(ShopEntity.class, id);
        return shopEntity;
    }

    @Override
    public void save(String shopName, String remark) {
        if (null == shopEntity) {
            shopEntity = new ShopEntity();
        }
        shopEntity.setShopName(shopName);
        shopEntity.setRemark(remark);
        shopEntity.save();
    }
}
